<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../commons/taglibs.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>Login</title>
<%@include file="../commons/meta.jsp"%>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<meta name="viewport" content="device-width,initial-scale=1.0">

<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css"
	rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="${ctx }/javascript/md5.js"></script>

<style type="text/css">
#big {
	width: auto;
	height: auto;
}
</style>

</head>

<body style="font-family:'楷体'; font-size:24px;background: #DADADA;">
	<div id="big" align="center">
		<form class="form-horizontal" action="wumimember/memberaction!login"
			name="loginForm" id="loginForm" method="post" role="from">
			<input type="hidden" name="member.openid" value="${member.openid }">
			<input type="hidden" name="member.toUserName"
				value="${member.toUserName }">

			<table width="295" height="287" border="0" style="margin-top: 50px;">
				<tr>
					<td height="50" colspan="2"
						style="text-align:center; font-size:26px;">会员登录</td>
				</tr>
				<tr>
					<td width="79" height="44" style="text-align:right;"><label>用户名</label>
					</td>
					<td width="200">
						<div class="col-sm-8">
							<input type="text" class="form-control" name="member.loginName"
								id="loginName" placeholder="请输入用户名">
						</div>
					</td>
				</tr>
				<tr>
					<td height="41" style="text-align:right;"><label>密码</label></td>
					<td><div class="col-sm-8">
							<input type="password" class="form-control"
								name="member.password" id="password" placeholder="请输入密码"
								value="${myLoginName }">
						</div></td>
				</tr>
				<tr>
					<td height="45" colspan="2" style="text-align:center;"><div
							id="Message">
							<span style="color: red;">${result}</span>
						</div></td>
				</tr>
				<tr>
					<td height="43" colspan="2" style="text-align:center;"><a
						href="findpassword/find-password-1.jsp">忘记密码</a></td>
				</tr>
				<tr>
					<td height="48" colspan="2" style="text-align:center;">
						<button type="button" class="btn btn-primary" id="memberlogin"
							onclick="toLogin()">登陆</button>
						<button type="button" class="btn btn-primary"
							onclick="window.location.href='wumimember/memberaction!memberRegister?member.openid=${member.openid }&member.toUserName=${member.toUserName }'">注册</button>
					</td>
				</tr>
			</table>
		</form>
		<div style="width: auto;height: auto;margin-top: 200px;">
			<c:import url="/jsp/commons/footer.jsp"></c:import>
		</div>
	</div>
</body>

<script type="text/javascript">
	function toLogin() {
		var loginName = $("#loginName").val();
		var password = $("#password").val();

		if (loginName.length == 0) {
			$("#Message").html("<span style='color: red;'>请输入用户名</span>");
			return false;
		} else {
			$("#Message").html("");
		}
		if (password.length == 0) {
			$("#Message").html("<span style='color: red;'>请输入密码</span>");

		} else {
			$("#Message").html("");
			document.getElementById("password").value = faultylabs
					.MD5(password);
			document.getElementById("loginForm").submit();
		}

	}
</script>

</html>
